import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

let router = new Router({

  routes: [
    {
      path: '',
      redirect: 'music',//默认加载 music 组件
    },
    {
      path: '/music',
      name: 'music',
      component: () => import('./views/music/Music.vue'),
    },
    {
      //推荐页
      path: '/recommend',
      name: 'recommend',
      component: () => import('./views/music/Recommend.vue'),
    },
    {
      //排行页
      path: '/rank',
      name: 'rank',
      component: () => import('./views//music/Rank.vue')
    },
    {
      //歌手页
      path: '/singer',
      name: 'singer',
      component: () => import('./views//music/Singer.vue')
    },
    {
      //歌单详情
      path: '/songlist/:id',
      name: 'songlist',
      component: () => import('./views//music/Songlist.vue')
    },
    {
      //排行榜详情
      path: '/rankinfo/:id',
      name: 'rankinfo',
      component: () => import('./views//music/Rankinfo.vue')
    },
    {
      //排行榜详情
      path: '/singerinfo/:id',
      name: 'singerinfo',
      component: () => import('./views//music/Singerinfo.vue')
    },
    {
      //搜索
      path: '/search',
      name: 'search',
      component: () => import('./views/Search.vue')
    },
  ]
})


export default router
